﻿using Entity.Finance.DTO.IncomeRefund;
using Entity.Finance.View.IncomeRefund;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Service;
using Service.System;

namespace AnQinManagermentBackendAPI.Controller.Finance
{
    /// <summary>
    /// 应收退款单
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    [Authorize]
    [AllowAnonymous]
    public class IncomeRefundsController : ControllerBase
    {
        /**
         * 业务接口
         */
        private readonly IncomeRefundService _service;

        /**
         * 构造函数注入
         */
        public IncomeRefundsController(IncomeRefundService service)
        {
            _service = service;
        }

        /// <summary>
        /// 获取列表
        /// </summary>
        [HttpGet]
        [ProducesResponseType(typeof(IncomeRefundView), 200)]
        public async Task<IActionResult> GetIncomeRefundList([FromQuery] IncomeRefundSearchDTO model)
        {
            var response = await _service.GetIncomeRefundList(model);
            return StatusCode(response.Status, response);
        }

        ///// <summary>
        ///// 新增
        ///// </summary>
        //[HttpPost]
        //public async Task<IActionResult> AddIncomeRefund([FromBody] IncomeRefundAddDTO model)
        //{
        //    var response = await _service.AddIncomeRefund(model);
        //    return StatusCode(response.Status, response);
        //}

        ///// <summary>
        ///// 修改
        ///// </summary>
        //[HttpPut]
        //public async Task<IActionResult> PutIncomeRefund([FromBody] IncomeRefundUpdateDTO model)
        //{
        //    var response = await _service.PutIncomeRefund(model);
        //    return StatusCode(response.Status, response);
        //}

        ///// <summary>
        ///// 删除
        ///// </summary>
        //[HttpDelete]
        //public async Task<IActionResult> DeleteIncomeRefund([FromQuery] string Id)
        //{
        //    var response = await _service.DeleteIncomeRefund(Id);
        //    return StatusCode(response.Status, response);
        //}

    }
}
